unit udmPub;

interface

uses
  SysUtils, Classes, DB, DBClient, MConnect, SConnect, ADODB, Provider;

type
  TdmPub = class(TDataModule)
    scPub: TSocketConnection;
    cdsPub: TClientDataSet;
    dsPub: TDataSource;
    scInterface: TSocketConnection;
    procedure scPubBeforeConnect(Sender: TObject);
    procedure DataModuleDestroy(Sender: TObject);
    procedure scInterfaceBeforeConnect(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  dmPub: TdmPub;

implementation

uses ufrmClient;

{$R *.dfm}

procedure TdmPub.scPubBeforeConnect(Sender: TObject);
begin
  scPub.Host := frmClient.ServerInfo.Host;
  scPub.Port := frmClient.ServerInfo.Port;
end;

procedure TdmPub.DataModuleDestroy(Sender: TObject);
begin
  scPub.Close;
  scInterface.Close;
end;

procedure TdmPub.scInterfaceBeforeConnect(Sender: TObject);
begin
  scInterface.Host := frmClient.ServerInfo.Host;
  scInterface.Port := frmClient.ServerInfo.Port;
end;

end.
